package io.renren.modules.lanling.service.impl;

import io.renren.modules.lanling.entity.ExamEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.lanling.dao.ExamDatailsDao;
import io.renren.modules.lanling.entity.ExamDatailsEntity;
import io.renren.modules.lanling.service.ExamDatailsService;


@Service("examDatailsService")
public class ExamDatailsServiceImpl extends ServiceImpl<ExamDatailsDao, ExamDatailsEntity> implements ExamDatailsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //todo 自定义分页列表
        Query query = new Query(params);
        List<ExamDatailsEntity> list = this.baseMapper.queryList(query);
        Integer total = this.baseMapper.queryTotal(query);

        return new PageUtils(list, total, query.getLimit(), query.getCurrPage());
    }

    @Override
    public void deleteByUserId(long studentId) {
        this.baseMapper.deleteByUserId(studentId);
    }

}
